<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<sys:genericTag4o id="columnsTag" methodName="getColumnList" className="com.tmpt.controller.taglib.TemplateTag">
	<sys:columnTag columnName="keyRandom" columnValue="${paramValues._keyRandom[0]}"/>
	<sys:columnTag columnName="add_editUrl" columnValue="/admin123/template/templateAjax_addeditData.action?_keyRandom=${paramValues._keyRandom[0]}"/>
	<sys:columnTag columnName="removeUrl" columnValue="/admin123/template/templateAjax_removeData.action?_keyRandom=${paramValues._keyRandom[0]}"/>
	<sys:columnTag columnName="reportUrl" columnValue="/admin123/template/template_downloadReport.action?_keyRandom=${paramValues._keyRandom[0]}"/>
</sys:genericTag4o>

正在加载中，请稍等...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

<title></title>
<%@include file="../base_resource.jsp"%>
<link href="${path}/admin123/css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/bootstrap/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/icon.css"/>
<script type="text/javascript" src="${path}/js/jquery-1.8.0.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/jquery.easyui.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/locale/easyui-lang-zh_CN.js"></script>

<script type="text/javascript" src="${path}/js/jquery.select.js"></script>

<script type="text/javascript">
var _path = '${path}';
var _keyRandom='${paramValues._keyRandom[0]}';
var _primaryKey='${columnsTag.templateTable.primaryKey}';
//上个页面通过右击列表 传过来的 id和row; ps:右击模板x列，看模板列列表，自动加载列数，要传模板id找表名
var _prePageListRow = '${paramValues.row[0]}';
_prePageListRow = decodeURI(_prePageListRow);
var _prePageListId = '${paramValues._id[0]}';
//template table foreign key
var _foreignKey = '${columnsTag.templateTable.foreignKey}';
//页面传过来的参数(form submit)
var _parameter1_iframedialog_menu2Id = '${paramValues.parameter1_iframedialog[0]}';
var _parameter2_iframedialog = '${paramValues.parameter2_iframedialog[0]}';
var _parameter3_iframedialog = '${paramValues.parameter3_iframedialog[0]}';

//add dialog width and height 
var _width4AddDialog = '${columnsTag.templateTable.width4AddDialog}';
var _height4AddDialog = '${columnsTag.templateTable.height4AddDialog}';
if(_width4AddDialog == '' || _width4AddDialog == '0')_width4AddDialog=800;
if(_height4AddDialog == '' || _height4AddDialog == '0')_height4AddDialog=400;
//dialog style, 取代上面的方法
var _isdialog4AddDialog = '${columnsTag.templateTable.isdialog4AddDialog}';
var _style4AddDialog = '${columnsTag.templateTable.style4AddDialog}';
if(_style4AddDialog == '')_style4AddDialog='width:800px;height:400px';
//

var datagrid={
    datagridId:"list",
    datagridUrl:"templateAjax_queryListBySearch.action?_keyRandom=${paramValues._keyRandom[0]}",
    datagridObj:{
        /*title:"查询列表",*/
        nowrap:true,
        autoRowHeight:false,
        fit:true,
        columns:[${columnsTag.columns}],
		frozenColumns:[${columnsTag.frozenColumns}],
        ${columnsTag.toolbarBtns}
        rownumbers:true,
        showFooter:true,
        onRowContextMenu:onRowContextMenu
    }
};

/*datagrid.datagridObj.rowStyler = function(index,row){
	/!*if (row.listprice>2){*!/
	if (index%2==1){
		return 'background-color:#efefef;color:#222;'; // return inline style
		// the function can return predefined css class and inline style
		// return {class:'r1', style:{'color:#fff'}};
	}
};*/

//添加右击菜单内容
var id;
var rowIndex;
function onRowContextMenu(e, rowIndex1, rowData){
	e.preventDefault();
	rowIndex = rowIndex1;
	var selected=$("#list").datagrid('getRows'); //获取所有行集合对象
	if(selected[rowIndex] == null){return;}
	id = selected[rowIndex].${columnsTag.templateTable.primaryKey}; //index为当前右键行的索引，指向当前行对象
	$('#rightMenuDiv').menu('show', {
	    left:e.pageX,
	    top:e.pageY
	});
};

//Add dialog 中combobox 选择时，看看哪些字段不用输入，直接隐藏了
var _columnCombobox4AddArray = new Array();
var _columnCombobox4AddJsonArray = new Array();

//所有列备份一下，一会隐藏了，可以恢复
var _columnDivArray = new Array();

$(function(){
	window.onload = inputPlaceholder();
});

</script>
<script type="text/javascript" src="${path}/js/myjs/myutils.js?random=<%=Math.random()%>"></script>
<script type="text/javascript" src="${path}/js/myjs/template_datagrid.js?random=<%=Math.random()%>"></script>
<script type="text/javascript" src="${path}/js/myjs/template_datagrid_condition.js?random=<%=Math.random()%>"></script>
<script src="${path}/js/jquery.iframeWin.js?random=<%=Math.random()%>"></script>

<style type="text/css">
	.west{width: 200px;padding: 3px;}
	.north{padding:3px;}
	.center{padding: 3px;}

	.clearboth{clear:both;	}
	.div_center{}
	#g .datagrid-btable tr{height: 30px;}
	/*#_conditionDiv{margin-bottom: -20px;}*/
</style>

</head>
<body class="easyui-layout" style="margin: 2px;" >
	<%--<input type="hidden" id="templateTableColumnOptionJsonText" size=200 value='${templateTableColumnOptionJson}'/>--%>
	<input type="hidden" id="_defaultValueJOStr" size=200 value='${columnsTag.defaultValueJOStr}'/>

	<div id="_conditionDiv" region="north" class="north" data-options="split:false,collapsed:false"><!-- ,minHeight:30 -->
        <%@ include file="conditionNorth.jsp" %> 
	</div>
	<div region="center" id="g" class="center" >
        <table id="list" class="datagrid_table" width="100%" ></table>
        <!-- 
		<s:form 
			id="downloadReportForm" 
			name="downloadReportForm" 
			action="template_downloadReport.action?_keyRandom=%{#attr._keyRandom}"
			namespace="/admin123/template" 
			theme="simple"
			target="_blank"/>
			 -->
	</div>

	<!-- 添加弹出框 添加 -->
	<%--<div id="win" class="easyui-dialog" title="添加修改数据框"　
		 style="display:none;<s:if test="#attr.templateTable.style4AddDialog!=null && #attr.templateTable.style4AddDialog!=''"> ${templateTable.style4AddDialog}</s:if><s:else>width:800px;height:400px</s:else>"
		 data-options="iconCls:'icon-save',modal:true,resizable:true"
		 buttons="#dlg-buttons">
		<%@ include file="templateList_adddata.jsp" %>
	</div>--%>
	
	<%--<!-- 添加弹出框 Buttons -->
	<div id="dlg-buttons">
		<table cellpadding="0" cellspacing="0" style="width:100%">
			<tr>
				<td style="text-align:right">
					<a href="${path}/admin123/layoutui/layoutUI.jsp?_keyRandom=${paramValues._keyRandom[0]}" target="_blank" class="easyui-linkbutton" iconCls="icon-edit">定制布局</a>
					<a href="#" id="form_addButton" class="easyui-linkbutton" iconCls="icon-save">保存</a>
					<a href="#" id="form_closeButton" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
				</td>
			</tr>
		</table>
	</div>--%>
	
	
	<!-- 右击菜单 -->
	<div id="rightMenuDiv" class="easyui-menu" style="width:200px;">
		<s:iterator var="mapRightMenu" value="#attr.columnsTag.rightMenuContext" status="st" >
			<%--<sec:authorize url="${mapRightMenu.url}">--%>
				<div onClick="rightMenuItemClick('${mapRightMenu.url}','${mapRightMenu.isDialog}','${mapRightMenu.width}','${mapRightMenu.height}','${mapRightMenu.itemName}')" data-options="iconCls:'icon-add'">
					<s:property value="itemName"/>
				</div>
			<%--</sec:authorize>--%>
		</s:iterator>   
	</div>
	
	<div id="win_common" class="easyui-dialog" iconCls="icon-add"/>  

</body>
</html>




